package com.TwinBlade.PicturePassword;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.graphics.Color;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;

public class Preferences extends PreferenceActivity
  implements Preference.OnPreferenceChangeListener
{
  private Context a;
  private SharedPreferences b;
  private Preference c;
  private Preference d;
  private Preference e;

  private void a()
  {
    Preference localPreference1 = findPreference("ThemeColor");
    Preference localPreference2 = findPreference("InfoPanel");
    Preference localPreference3 = findPreference("LockAfterWidgetLocker");
    Preference localPreference4 = findPreference("MusicControl");
    Preference localPreference5 = findPreference("OwnersInfo");
    if (!bd.a(this))
    {
      this.b.edit().putInt("LockDelayMinute", 0).commit();
      this.b.edit().putInt("LockDelaySecond", 0).commit();
      this.b.edit().putInt("ThemeColor", Color.rgb(57, 146, 181)).commit();
      this.b.edit().putBoolean("InfoPanel", false).commit();
      this.b.edit().putBoolean("LockAfterWidgetLocker", false).commit();
      this.b.edit().putBoolean("MusicControl", false).commit();
      this.b.edit().putString("OwnersInfo", "").commit();
      localPreference1.setEnabled(false);
      this.d.setEnabled(false);
      localPreference2.setEnabled(false);
      localPreference3.setEnabled(false);
      localPreference4.setEnabled(false);
      localPreference5.setEnabled(false);
      this.b.edit().putString("FourthGestureData", "0").commit();
      this.b.edit().putString("FifthGestureData", "0").commit();
      this.b.edit().putString("FourthGestureType", "none").commit();
      this.b.edit().putString("FifthGestureType", "none").commit();
      this.e.setTitle(getString(2131296287));
      this.e.setSummary("");
      this.e.setEnabled(true);
      return;
    }
    localPreference1.setEnabled(true);
    this.d.setEnabled(true);
    localPreference2.setEnabled(true);
    localPreference3.setEnabled(true);
    localPreference4.setEnabled(true);
    localPreference5.setEnabled(true);
    this.e.setTitle(getString(2131296285));
    String str = getString(2131296286);
    if (!this.b.getString("PayPalKey", "-1").equals("-1"))
      str = str + ". Press to copy the PayPal Serial Key";
    while (true)
    {
      this.e.setSummary(str);
      return;
      this.e.setEnabled(false);
    }
  }

  protected void onActivityResult(int paramInt1, int paramInt2, Intent paramIntent)
  {
    super.onActivityResult(paramInt1, paramInt2, paramIntent);
    switch (paramInt1)
    {
    default:
      return;
    case 1:
    }
    if (paramInt2 == -1)
    {
      this.c.setEnabled(true);
      return;
    }
    this.c.setEnabled(false);
  }

  public void onCreate(Bundle paramBundle)
  {
    Utilities.e(this);
    super.onCreate(paramBundle);
    addPreferencesFromResource(2131099649);
    this.b = PreferenceManager.getDefaultSharedPreferences(this);
    this.a = this;
    this.d = findPreference("ThemeColorReset");
    this.d.setOnPreferenceClickListener(new bf(this));
    this.c = findPreference("NavBarMode");
    this.c.setOnPreferenceChangeListener(this);
    this.e = findPreference("PlusKey");
    this.e.setOnPreferenceClickListener(new bg(this));
  }

  public boolean onPreferenceChange(Preference paramPreference, Object paramObject)
  {
    if (paramPreference.equals(this.c))
    {
      if (((Boolean)paramObject).booleanValue())
      {
        Intent localIntent1 = new Intent(this, Root.class);
        localIntent1.putExtra("Install", true);
        startActivityForResult(localIntent1, 1);
        return true;
      }
      Intent localIntent2 = new Intent(this, Root.class);
      localIntent2.putExtra("Install", false);
      startActivityForResult(localIntent2, 1);
      return true;
    }
    return false;
  }

  public void onResume()
  {
    super.onResume();
    a();
  }
}

/* Location:           D:\Studium\Bachelorarbeit\BA Marcus Wobig\BA\BA\Decompiler\PicturePassword APK\Programm\PicturePassword_dex2jar.jar
 * Qualified Name:     com.TwinBlade.PicturePassword.Preferences
 * JD-Core Version:    0.6.2
 */